<?php
require_once '../config/config.php';
isset($_REQUEST['token']) ? $token = $_REQUEST['token'] : $token = '';
$row = $_db->query("select * from token where `key`='$token'")->fetch();
$re = $_db->query("select `petname` AS `name`,`motto`,`sex`,`icon` from `user` WHERE uid='{$row['uid']}'")->fetch(PDO::FETCH_ASSOC);
echo json_encode($re);